package cn.shenshen.shop.web.controller;

import cn.shenshen.shop.service.ISeckillGoodService;
import cn.shenshen.shop.util.Result;
import cn.shenshen.shop.vo.GoodVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/seckillGood")
public class SeckillGoodController {

    @Autowired
    private ISeckillGoodService seckillGoodService;

    //200 * 20 ==>1276
    @RequestMapping("query")
    public Result<List<GoodVo>> query(){
        List<GoodVo> list = seckillGoodService.query();
            return Result.success(list);
    }

    @RequestMapping("find")
    public Result<GoodVo> find(Long goodId){
        GoodVo goodVo = seckillGoodService.find(goodId);
        return Result.success(goodVo);
    }

}
